<?
    switch ($this->level)
    {
        case 1:
            echo "<ul>".$this->companies($this->collection_company)."</ul>";
            break;

        case 2:
            echo $this->company($this->model_company);
            break;

        case 3:
            echo $this->spa($this->collection_spa);
            break;

        case 4: // Navigate to the Company
            echo "<ul>";
            $result = $this->companies($this->collection_company, $this->target_model_company);

            /*
            if ($this->parent_id != -1)
            {
                $result = $this->companies(array(
                    "company_collection" => $this->main_companies,
                    "id" => $this->parent_id,
                    "expand" => $result.$this->types(array("model_company" => $this->model_company_pool)))
                );
            };
            */

            echo $result."</ul>";
            break;


        case 5: // Navigate to the SPA
            echo "<ul>";

            $result = $this->types(array(
                "types" => $this->company_types,
                "id" => $this->type_id,
                "expand" => $this->spa())
            );

            if (($this->model_company->isCompanyInPool()) || ($this->model_company->isPool()))
            {
                if ($this->model_company->isCompanyInPool())
                {
                    $result = $this->companies(array(
                        "id" => $this->model_company->getID(),
                        "expand" => $result,
                        "pool_id" => $this->model_company->getModelPool()->getID())
                    );

                    $result .= $this->types(array("model_company" => $this->model_company_pool));

                    $result = $this->companies(array(
                        "companies" => $this->main_companies,
                        "id" => $this->model_company->getModelPool()->getID(),
                        "expand" => $result)
                    );
                }
                else
                {
                    $result = $this->companies(array(
                        "companies" => $this->main_companies,
                        "id" => $this->model_company->getID(),
                        "expand" => $this->companies(array("pool_id" => $this->model_company->getModelPool()->getID())).$result)
                    );
                };

            }
            else
                $result = $this->companies(array("id" => $this->model_company->getID(), "expand" => $result));

            echo $result."</ul>";
            break;
    } // switch ($this->level)
?>